// pages/comments/index.js
import {getProductionList} from "../../service/index"
Page({
  data: {
    goods_Id: '',
    commentsAll: [],
    goodComment:[],
    midComment:[],
    badComment:[],
    page:1,
    scoreType:-1
  },

  onLoad: function (options) {
    // 获取传递的商品ID
    const goods_Id = options.goodsId;
    console.log(goods_Id);
    this.setData({
      goods_Id: goods_Id
    });
    // 调用获取评论列表的方法
    this.getCommentList();
  },
  getCommentList:function () {
    const goods_Id = this.data.goods_Id;
    const page = this.data.page
    const scoreType = this.data.scoreType
    // console.log(111111111,goods_Id);
    // 调用方法
    getProductionList(goods_Id,scoreType,page,(data)=>{
      console.log(6666,data);
      const {list} = data.data
      console.log(list);
      this.setData({
        commentsAll:list
      })
    })

  }
})